package com.extweb4j.core.model;

import java.util.List;

/**
 * 投票角色关系
 * @author Administrator
 *
 */
public class ExtVoteRole extends CoreModel<ExtVoteRole>{
	
	private static final long serialVersionUID = 1L;

	public static ExtVoteRole dao = new ExtVoteRole();
	
	public boolean isAuth(String vote_id,String user_id){
		StringBuffer sql = new StringBuffer();
		sql.append("SELECT * FROM ext_vote_role ");
		sql.append(" WHERE vote_id=? ");
		sql.append(" AND role_id=(SELECT role_id FROM ext_user_role WHERE user_id=?)");
		List<ExtVoteRole> vr = ExtVoteRole.dao.find(sql.toString(),vote_id,user_id);
		return vr.size()>0?true:false;
	}
}
